@page
@{ Layout = "_LayoutApp"; }
@section Styles{
    <style>
        .number{
            color:red;
            font-size:28px;
        }
    </style>
}
<el-card class="rounded-0">
    <div slot="header" class="text-center pt-3">
        <span class="fw-bold"><i class="el-icon-s-order me-2"></i>{{ item.title }}</span>
    </div>
    <div class="row">
        <div class="col-md-12 col-12">
            <div class="row text-center" v-if="item.examStartDateTimeLong>0 && !isStart">
                <div class="col-md-12 mb-5">
                    <div>
                        <el-statistic :value="item.examStartDateTimeLong" class="text-warning"
                                      time-indices format="DD天HH小时mm分钟ss秒" v-on:finish="timingFinish"
                                      title="距离开考还剩：">
                        </el-statistic>
                    </div>
                </div>
            </div>
            <div class="row gy-3">
                <div class="col-xl-6 col-lg-6 col-md-6 col-6">
                    <div class="card rounded-0 bg-white border-5 border-start-0 border-end-0 border-bottom-0 card-hover-with-icon">
                        <div class="card-body pt-3 pb-0">
                            <div class="d-flex align-items-center justify-content-between">
                                <div>
                                    <div class="mb-2 fw-bold">
                                        <span>{{ item.totalScore }}</span>
                                        分
                                    </div>
                                    <p class="text-muted fs-6">试卷总分</p>
                                </div>
                                <div class="icon-shape icon-sm rounded-circle text-muted card-icon">
                                    <i class="bi bi-check-circle-fill fs-3"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-6 col-lg-6 col-md-6 col-6">
                    <div class="card rounded-0 bg-white border-5 border-start-0 border-end-0 border-bottom-0 card-hover-with-icon">
                        <div class="card-body pt-3 pb-0">
                            <div class="d-flex align-items-center justify-content-between">
                                <div>
                                    <div class="mb-2 fw-bold">
                                        <span>{{ item.passScore }}</span>
                                        分
                                    </div>
                                    <p class="text-muted fs-6">及格分</p>
                                </div>
                                <div class="icon-shape icon-sm rounded-circle text-muted card-icon">
                                    <i class="bi bi-check-circle fs-3"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-12 col-lg-12 col-md-12 col-12">
                    <div class="card rounded-0 bg-white border-5 border-start-0 border-end-0 border-bottom-0 card-hover-with-icon">
                        <div class="card-body pt-3 pb-0">
                            <div class="d-flex align-items-center justify-content-between">
                                <div v-if="item.cerId>0">
                                    <div class="mb-2 fw-bold"><span>{{item.cerName}}</span></div>
                                    <p class="text-muted fs-6">考试通过可获得证书</p>
                                </div>
                                <div v-else>
                                    <div class="mb-2"><span>无证书</span></div>
                                    <p class="text-muted fs-6">考试通过可获得证书</p>
                                </div>
                                <div class="icon-shape icon-sm rounded-circle text-muted card-icon">
                                    <i class="bi bi-award-fill fs-3"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-6 col-lg-6 col-md-6 col-6">
                    <div class="card rounded-0 bg-white border-5 border-start-0 border-end-0 border-bottom-0 card-hover-with-icon">
                        <div class="card-body pt-3 pb-0">
                            <div class="d-flex align-items-center justify-content-between">
                                <div>
                                    <div class="mb-2 fw-bold" v-if="item.isTiming"><span>{{item.timingMinute}}</span>分钟</div>
                                    <div class="mb-2 fw-bold" v-else>不限时</div>
                                    <p class="text-muted fs-6">考试限时</p>
                                </div>
                                <div class="icon-shape icon-sm rounded-circle text-muted card-icon">
                                    <i class="bi bi-clock-fill fs-3"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-6 col-lg-6 col-md-6 col-6">
                    <div class="card rounded-0 bg-white border-5 border-start-0 border-end-0 border-bottom-0 card-hover-with-icon">
                        <div class="card-body pt-3 pb-0">
                            <div class="d-flex align-items-center justify-content-between">
                                <div>
                                    <div class="mb-2">
                                        <span class="text-success fw-bold" v-if="(item.userExamTimes-item.myExamTimes)>0">
                                            {{item.userExamTimes-item.myExamTimes}}
                                        </span>
                                        <span class="mb-2 text-danger fw-bold" v-else>
                                            0
                                        </span>
                                        /{{item.userExamTimes}}
                                    </div>
                                    <p class="text-muted  fs-6">剩余考试次数</p>
                                </div>
                                <div class="icon-shape icon-sm rounded-circle text-muted card-icon">
                                    <i class="bi bi-circle-half fs-3"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-12 col-lg-12 col-md-12 col-12">
                    <div class="card rounded-0 bg-white border-5 border-start-0 border-end-0 border-bottom-0 card-hover-with-icon">
                        <div class="card-body pt-3 pb-0">
                            <div class="d-flex align-items-center justify-content-between">
                                <div>
                                    <div class="mb-2 fw-bold">{{ item.examStartDateTimeStr }} - {{ item.examEndDateTimeStr }}</div>
                                    <p class="text-muted fs-6">考试时间</p>
                                </div>
                                <div class="icon-shape icon-sm rounded-circle text-muted card-icon">
                                    <i class="bi bi-calendar-check-fill fs-3"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-12 col-lg-12 col-md-12 col-12" v-if="(item.cjList && item.cjList.length>0)">
                    <div class="card rounded-0 bg-white border-5 border-start-0 border-end-0 border-bottom-0 card-hover-with-icon">
                        <div class="card-body pt-3 pb-0">
                            <el-collapse accordion>
                                <el-collapse-item>
                                    <template slot="title">
                                        <span class="fs-4"><i class="bi bi-clock-history me-2"></i>考试记录（{{ item.cjList.length }}）</span>
                                    </template>
                                    <div>
                                        <div v-for="(paper,index) in item.cjList">
                                            <el-card shadow="hover" class="mb-2 rounded-0">
                                                <div class="d-flex align-items-center justify-content-between">
                                                    <div>
                                                        <div class="mb-2">{{ paper.endDateTime }}</div>
                                                        <div class="mb-2" v-if="item.isTiming">用时：{{ paper.useTime }}</div>
                                                        <div class="mb-2">
                                                            成绩：
                                                            <span v-if="item.secrecyScore">
                                                                <span>{{ paper.score }}</span>
                                                            </span>
                                                            <span class="text-danger" v-else><i class="bi bi-eye-slash-fill me-2"></i>未公开</span>
                                                        </div>
                                                    </div>
                                                    <div>
                                                        <el-button type="primary" circle plain icon="el-icon-view" v-on:click.stop="btnViewClick(paper.id)" v-if="item.secrecyPaperContent"></el-button>
                                                        <el-button type="danger" circle v-else disabled><i class="bi bi-eye-slash-fill"></i></el-button>
                                                    </div>
                                                </div>
                                            </el-card>
                                        </div>
                                    </div>
                                </el-collapse-item>
                            </el-collapse>
                        </div>
                    </div>
                </div>
                <div class="col-xl-12 col-lg-12 col-md-12 col-12" v-if="(item.subject && item.subject.length>0)">
                    <div class="card rounded-0 bg-white border-5 border-start-0 border-end-0 border-bottom-0 card-hover-with-icon">
                        <div class="card-body pt-3 pb-0">
                            <el-collapse accordion>
                                <el-collapse-item>
                                    <template slot="title">
                                        <span class="fs-4"><i class="el-icon-info me-2"></i>考试须知</span>
                                    </template>
                                    <div>
                                        <p v-html="item.subject"></p>
                                    </div>
                                </el-collapse-item>
                            </el-collapse>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</el-card>
<div class="py-8"></div>
<div style="position:fixed;left:0;bottom:0;width:100%;" class="text-center mb-5 animate__animated animate__fadeInUp">
    <el-button-group class="rounded-0">
        <template v-if="item.examSubmiting">
            <el-button class="rounded-0" icon="el-icon-s-promotion" type="warning" :loading="item.examSubmiting">正在交卷...</el-button>
        </template>
        <template v-else>
            <el-button class="rounded-0" icon="el-icon-s-promotion" type="warning" v-on:click="btnStartExamClick" v-if="item.startId>0 && isStart">准备就绪，恢复考试</el-button>
            <el-button class="rounded-0" icon="el-icon-s-promotion" type="success" v-on:click="btnStartExamClick" v-else-if="isStart">准备就绪，开始考试</el-button>
        </template>
        <el-button class="rounded-0" v-on:click="utils.closeLayerSelf" icon="el-icon-back" v-if="isStart">返 回</el-button>
        <el-button class="rounded-0" v-on:click="utils.closeLayerSelf" icon="el-icon-back" v-else>返 回</el-button>
    </el-button-group>
</div>
@section Scripts{
<script src="/sitefiles/assets/js/app/exam/examPaperInfo.js" type="text/javascript"></script> }